VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "ClsAnchosGrid"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

Private anchosMin() As Long
Private anchosMax() As Long
Public cantCol As Integer

Public Function getAnchoMin(colNum As Integer)
    getAnchoMin = anchosMin(colNum)
End Function
Public Function getAnchoMax(colNum As Integer)
    getAnchoMax = anchosMax(colNum)
End Function

Public Sub setAnchosMin(anchos As Variant)
    ReDim anchosMin(UBound(anchos)) As Long
    Dim i As Integer
    For i = 0 To UBound(anchos)
        anchosMin(i) = anchos(i)
    Next
End Sub
Public Sub setAnchosMax(anchos As Variant)
    ReDim anchosMax(UBound(anchos)) As Long
    Dim i As Integer
    For i = 0 To UBound(anchos)
        anchosMax(i) = anchos(i)
    Next
End Sub

Public Sub revisarAnchos(HFG As MSHFlexGrid)
    Dim i As Integer
    For i = 0 To HFG.Cols - 1
        If HFG.ColWidth(i) < anchosMin(i) Then
            HFG.ColWidth(i) = anchosMin(i)
        ElseIf HFG.ColWidth(i) > anchosMax(i) Then
            HFG.ColWidth(i) = anchosMax(i)
        End If
    Next
End Sub
